var loginWinow = Titanium.UI.createWindow({
	tite:'Emakan :: Login',
	//backgroundColor:'#c8c8c8'
	backgroundImage:'images/bg.png',
	    orientationModes: [
        Ti.UI.LANDSCAPE_LEFT,
        Ti.UI.LANDSCAPE_RIGHT,
        Ti.UI.PORTRAIT,
        Ti.UI.UPSIDE_PORTRAIT
    ]
});
Ti.Gesture.addEventListener('orientationchange',function(e)
{

     // now do stuff... refresh etc..

    if(e.orientation == 1 || e.orientation == 2)
    {
        // Function that changes the left property of 
        // just about every item in the view
        //loginWinow.rotateStandard();
    }
    else if(e.orientation == 3 || e.orientation == 4)
    {
       // Window.rotateLandscape();
    }
    else
    {
        // Guess
        Window.rotateStandard();
    }
});
var logo = Titanium.UI.createView({
	backgroundImage:'images/logo.png',
	width:'100%',
	height:'50%',
	top:'0%',
	left:'0%'
});
loginWinow.add(logo);

var mailTextField = Titanium.UI.createTextField({
	hintText:'Mail',
    height:'13%',
    top:'40%',
    left:'10%',
    width:'80%',
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});

var passwordTextField = Titanium.UI.createTextField({
    hintText:'Password',
    height:'13%',
    top:'54%',
    left:'10%',
    width:'80%',
    passwordMask:true,
    borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});

var signIn = Titanium.UI.createButton({
	title:'SignIn',
	width:'30%',
	left:'20%',
	height:'12%',
	top:'68%',
	font:{
		fontSize:'12'
	}
});

var signUp = Titanium.UI.createButton({
	title:'SignUp',
	width:'30%',
	left:'50%',
	height:'12%',
	top:'68%',
	font:{
		fontSize:'12'
	}
});

var basicSwitch = Titanium.UI.createSwitch({
    style:Titanium.UI.Android.SWITCH_STYLE_CHECKBOX,
    value:false,
    top:'80%',
    left:'10%',
    width:'15%',
    height:'10%'
});

var signLabel = Titanium.UI.createLabel({
	text:'Keep Me Signed In',
	top:'80%',
	left:'25%',
	width:'100%',
	height:'10%',
	color:'#000',
	font: {
		fontWeight:'bold'
	}
});

loginWinow.add(basicSwitch);
loginWinow.add(signLabel);
loginWinow.add(signIn);
loginWinow.add(signUp);
loginWinow.add(mailTextField);
loginWinow.add(passwordTextField);

Titanium.include("/makan/control/loginHands.js");
loginWinow.open();

